<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">

    <form class="well form-inline margin-top-20" method="post" action="{:url('putmoney/index')}">
        打款状态:
        <select class="form-control" name="pay_status" style="width: 140px;">
            <option value='0'<eq name="pay_status" value="0">selected</eq>>全部</option>
            <option value='1'<eq name="pay_status" value="1">selected</eq>>已打款</option>
            <option value='2'<eq name="pay_status" value="2">selected</eq>>打款失败</option>
        </select> &nbsp;&nbsp;
       &nbsp;

        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('putmoney/index')}">清空</a>
    </form>
    <form class="js-ajax-form" action="" method="post">

        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="50">ID</th>
                <th>提现时间</th>
                <th>用户</th>
                <th>提现金额</th>
                <th width="230">银行卡名称</th>
                <th width="100">真实姓名</th>
                <th width="370">银行卡号</th>
                <th width="300">状态</th>
                <th width="200">操作</th>
            </tr>
            </thead>
                <foreach name="put_balance" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                        <td>{$vo.mobile}</td>
                        <td>{$vo.balance}</td>
                        <td>{$vo.card_name}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.card_code}</td>
                        <td>
                            <eq name="vo.status" value="0">未打款 </eq>
                            <eq name="vo.status" value="1">打款成功 </eq>
                            <eq name="vo.status" value="2">打款失败 :原因：{$vo.reason}</eq>
                        </td>
                        <td>
                            <eq name="vo.status" value="0">
                                <a class="btn btn-warning js-ajax-dialog-btn"  data-msg="您确定打款成功吗？" href="{:url('putmoney/put_success',array('id'=>$vo['id']))}">打款成功</a>
                                <a class="btn btn-info put_error"  href="javascript:;" data="{$vo['id']}">打款失败</a>

                            </eq>
                            <eq name="vo.status" value="1"><btton class="btn btn-info">打款成功</btton> </eq>
                            <eq name="vo.status" value="2"> <btton class="btn btn-danger">打款失败</btton></eq>
                        </td>
                    </tr>
                </foreach>
            <tfoot>
            </tfoot>
        </table>

        <ul class="pagination">{$pages|default=''}</ul>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(function () {
        $('.put_error').click(function () {
            var id=$(this).attr('data');
            Wind.use("layer", function () {
                layer.open({
                    id:1,
                    type: 1,
                    title:'拒绝理由',
                    area:['80%', 'auto'],
                    content: ' <div class="row" style="width: 100%;">'
                    +'<div>'
                    +'<div>'
                    +'<input type="text" class="refund_no_reason" placeholder="请输入拒绝理由" value="" style="width: 90%;margin-left: 4%;padding-left:1%;border: 1px #eee solid;height: 35px;margin-top: 3%;">'
                    +'</div>'
                    +'</div>'
                    +'</div>'              ,
                    btn:['提交'],
                    btn1: function (index,layero) {
                        var refund_no_reason=$('.refund_no_reason').val();
                        if(refund_no_reason==''){
                            layer.msg('请输入拒绝理由')
                            return;
                        }
                        $.ajax({
                            type: "POST",
                            url:"{:url('putmoney/put_error')}",
                            data: {
                                "refund_no_reason":refund_no_reason,
                                "id":id
                            },
                            dataType: "json",
                            success: function (data) {
                                window.location.reload();
                            }
                        })
                    }
                });
            })
        })
    })
</script>
</body>
</html>